3.14.44 \(\int \frac {\csc ^2(c+d x) \sec ^2(c+d x)}{a+b \sin (c+d x)} \, dx\) [1344]

3.14.44.1 Optimal result
3.14.44.2 Mathematica [A] (verified)
3.14.44.3 Rubi [A] (verified)
3.14.44.4 Maple [A] (verified)
3.14.44.5 Fricas [B] (verification not implemented)
3.14.44.6 Sympy [F]
3.14.44.7 Maxima [F(-2)]
3.14.44.8 Giac [B] (verification not implemented)
3.14.44.9 Mupad [B] (verification not implemented)

3.14.44.1 Optimal result

Integrand size = 29, antiderivative size = 128 \[ \int \frac {\csc ^2(c+d x) \sec ^2(c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {2 b^4 \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{a^2 \left (a^2-b^2\right )^{3/2} d}+\frac {b \text {arctanh}(\cos (c+d x))}{a^2 d}-\frac {\cot (c+d x)}{a d}-\frac {b \sec (c+d x)}{\left (a^2-b^2\right ) d}+\frac {a \tan (c+d x)}{\left (a^2-b^2\right ) d} \]

output
-2*b^4*arctan((b+a*tan(1/2*d*x+1/2*c))/(a^2-b^2)^(1/2))/a^2/(a^2-b^2)^(3/2 
)/d+b*arctanh(cos(d*x+c))/a^2/d-cot(d*x+c)/a/d-b*sec(d*x+c)/(a^2-b^2)/d+a* 
tan(d*x+c)/(a^2-b^2)/d
 
3.14.44.2 Mathematica [A] (verified)

Time = 0.87 (sec) , antiderivative size = 205, normalized size of antiderivative = 1.60 \[ \int \frac {\csc ^2(c+d x) \sec ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\frac {-\frac {4 b^4 \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{a^2 \left (a^2-b^2\right )^{3/2}}-\frac {\cot \left (\frac {1}{2} (c+d x)\right )}{a}+\frac {2 b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{a^2}-\frac {2 b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{a^2}+\frac {2 \sin \left (\frac {1}{2} (c+d x)\right )}{(a+b) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}+\frac {2 \sin \left (\frac {1}{2} (c+d x)\right )}{(a-b) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}+\frac {\tan \left (\frac {1}{2} (c+d x)\right )}{a}}{2 d} \]

input
Integrate[(Csc[c + d*x]^2*Sec[c + d*x]^2)/(a + b*Sin[c + d*x]),x]
 
output
((-4*b^4*ArcTan[(b + a*Tan[(c + d*x)/2])/Sqrt[a^2 - b^2]])/(a^2*(a^2 - b^2 
)^(3/2)) - Cot[(c + d*x)/2]/a + (2*b*Log[Cos[(c + d*x)/2]])/a^2 - (2*b*Log 
[Sin[(c + d*x)/2]])/a^2 + (2*Sin[(c + d*x)/2])/((a + b)*(Cos[(c + d*x)/2] 
- Sin[(c + d*x)/2])) + (2*Sin[(c + d*x)/2])/((a - b)*(Cos[(c + d*x)/2] + S 
in[(c + d*x)/2])) + Tan[(c + d*x)/2]/a)/(2*d)
 
3.14.44.3 Rubi [A] (verified)

Time = 0.48 (sec) , antiderivative size = 150, normalized size of antiderivative = 1.17, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {3042, 3377, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\csc ^2(c+d x) \sec ^2(c+d x)}{a+b \sin (c+d x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\sin (c+d x)^2 \cos (c+d x)^2 (a+b \sin (c+d x))}dx\)

\(\Big \downarrow \) 3377

\(\displaystyle \int \left (\frac {b^2 \sec ^2(c+d x)}{a^2 (a+b \sin (c+d x))}-\frac {b \csc (c+d x) \sec ^2(c+d x)}{a^2}+\frac {\csc ^2(c+d x) \sec ^2(c+d x)}{a}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {2 b^4 \arctan \left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{a^2 d \left (a^2-b^2\right )^{3/2}}+\frac {b \text {arctanh}(\cos (c+d x))}{a^2 d}-\frac {b^2 \sec (c+d x) (b-a \sin (c+d x))}{a^2 d \left (a^2-b^2\right )}-\frac {b \sec (c+d x)}{a^2 d}+\frac {\tan (c+d x)}{a d}-\frac {\cot (c+d x)}{a d}\)

input
Int[(Csc[c + d*x]^2*Sec[c + d*x]^2)/(a + b*Sin[c + d*x]),x]
 
output
(-2*b^4*ArcTan[(b + a*Tan[(c + d*x)/2])/Sqrt[a^2 - b^2]])/(a^2*(a^2 - b^2) 
^(3/2)*d) + (b*ArcTanh[Cos[c + d*x]])/(a^2*d) - Cot[c + d*x]/(a*d) - (b*Se 
c[c + d*x])/(a^2*d) - (b^2*Sec[c + d*x]*(b - a*Sin[c + d*x]))/(a^2*(a^2 - 
b^2)*d) + Tan[c + d*x]/(a*d)
 

3.14.44.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3377
Int[((cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*sin[(e_.) + (f_.)*(x_)]^(n_))/((a 
_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Int[ExpandTrig[(g*cos[e + 
 f*x])^p, sin[e + f*x]^n/(a + b*sin[e + f*x]), x], x] /; FreeQ[{a, b, e, f, 
 g, p}, x] && NeQ[a^2 - b^2, 0] && IntegerQ[n] && (LtQ[n, 0] || IGtQ[p + 1/ 
2, 0])
 
3.14.44.4 Maple [A] (verified)

Time = 0.55 (sec) , antiderivative size = 155, normalized size of antiderivative = 1.21

method result size
derivativedivides \(\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a}-\frac {1}{2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-\frac {b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{2}}-\frac {2 b^{4} \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{a^{2} \left (a -b \right ) \left (a +b \right ) \sqrt {a^{2}-b^{2}}}-\frac {1}{\left (a -b \right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {1}{\left (a +b \right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}}{d}\) \(155\)
default \(\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a}-\frac {1}{2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-\frac {b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{2}}-\frac {2 b^{4} \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{a^{2} \left (a -b \right ) \left (a +b \right ) \sqrt {a^{2}-b^{2}}}-\frac {1}{\left (a -b \right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {1}{\left (a +b \right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}}{d}\) \(155\)
risch \(-\frac {2 \left (-i b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+a b \,{\mathrm e}^{3 i \left (d x +c \right )}+2 i a^{2}-i b^{2}-a b \,{\mathrm e}^{i \left (d x +c \right )}\right )}{d a \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) \left (a^{2}-b^{2}\right ) \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {b^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \sqrt {-a^{2}+b^{2}}\, a -a^{2}+b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) d \,a^{2}}-\frac {b^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \sqrt {-a^{2}+b^{2}}\, a +a^{2}-b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) d \,a^{2}}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{a^{2} d}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{a^{2} d}\) \(308\)

input
int(csc(d*x+c)^2*sec(d*x+c)^2/(a+b*sin(d*x+c)),x,method=_RETURNVERBOSE)
 
output
1/d*(1/2*tan(1/2*d*x+1/2*c)/a-1/2/a/tan(1/2*d*x+1/2*c)-1/a^2*b*ln(tan(1/2* 
d*x+1/2*c))-2/a^2/(a-b)/(a+b)*b^4/(a^2-b^2)^(1/2)*arctan(1/2*(2*a*tan(1/2* 
d*x+1/2*c)+2*b)/(a^2-b^2)^(1/2))-1/(a-b)/(tan(1/2*d*x+1/2*c)+1)-1/(a+b)/(t 
an(1/2*d*x+1/2*c)-1))
 
3.14.44.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 250 vs. \(2 (123) = 246\).

Time = 0.52 (sec) , antiderivative size = 582, normalized size of antiderivative = 4.55 \[ \int \frac {\csc ^2(c+d x) \sec ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\left [\frac {\sqrt {-a^{2} + b^{2}} b^{4} \cos \left (d x + c\right ) \log \left (\frac {{\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2} + 2 \, {\left (a \cos \left (d x + c\right ) \sin \left (d x + c\right ) + b \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}}}{b^{2} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2}}\right ) \sin \left (d x + c\right ) + 2 \, a^{5} - 2 \, a^{3} b^{2} + {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} \cos \left (d x + c\right ) \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} \cos \left (d x + c\right ) \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 2 \, {\left (2 \, a^{5} - 3 \, a^{3} b^{2} + a b^{4}\right )} \cos \left (d x + c\right )^{2} - 2 \, {\left (a^{4} b - a^{2} b^{3}\right )} \sin \left (d x + c\right )}{2 \, {\left (a^{6} - 2 \, a^{4} b^{2} + a^{2} b^{4}\right )} d \cos \left (d x + c\right ) \sin \left (d x + c\right )}, \frac {2 \, \sqrt {a^{2} - b^{2}} b^{4} \arctan \left (-\frac {a \sin \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \cos \left (d x + c\right )}\right ) \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 2 \, a^{5} - 2 \, a^{3} b^{2} + {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} \cos \left (d x + c\right ) \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} \cos \left (d x + c\right ) \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 2 \, {\left (2 \, a^{5} - 3 \, a^{3} b^{2} + a b^{4}\right )} \cos \left (d x + c\right )^{2} - 2 \, {\left (a^{4} b - a^{2} b^{3}\right )} \sin \left (d x + c\right )}{2 \, {\left (a^{6} - 2 \, a^{4} b^{2} + a^{2} b^{4}\right )} d \cos \left (d x + c\right ) \sin \left (d x + c\right )}\right ] \]

input
integrate(csc(d*x+c)^2*sec(d*x+c)^2/(a+b*sin(d*x+c)),x, algorithm="fricas" 
)
 
output
[1/2*(sqrt(-a^2 + b^2)*b^4*cos(d*x + c)*log(((2*a^2 - b^2)*cos(d*x + c)^2 
- 2*a*b*sin(d*x + c) - a^2 - b^2 + 2*(a*cos(d*x + c)*sin(d*x + c) + b*cos( 
d*x + c))*sqrt(-a^2 + b^2))/(b^2*cos(d*x + c)^2 - 2*a*b*sin(d*x + c) - a^2 
 - b^2))*sin(d*x + c) + 2*a^5 - 2*a^3*b^2 + (a^4*b - 2*a^2*b^3 + b^5)*cos( 
d*x + c)*log(1/2*cos(d*x + c) + 1/2)*sin(d*x + c) - (a^4*b - 2*a^2*b^3 + b 
^5)*cos(d*x + c)*log(-1/2*cos(d*x + c) + 1/2)*sin(d*x + c) - 2*(2*a^5 - 3* 
a^3*b^2 + a*b^4)*cos(d*x + c)^2 - 2*(a^4*b - a^2*b^3)*sin(d*x + c))/((a^6 
- 2*a^4*b^2 + a^2*b^4)*d*cos(d*x + c)*sin(d*x + c)), 1/2*(2*sqrt(a^2 - b^2 
)*b^4*arctan(-(a*sin(d*x + c) + b)/(sqrt(a^2 - b^2)*cos(d*x + c)))*cos(d*x 
 + c)*sin(d*x + c) + 2*a^5 - 2*a^3*b^2 + (a^4*b - 2*a^2*b^3 + b^5)*cos(d*x 
 + c)*log(1/2*cos(d*x + c) + 1/2)*sin(d*x + c) - (a^4*b - 2*a^2*b^3 + b^5) 
*cos(d*x + c)*log(-1/2*cos(d*x + c) + 1/2)*sin(d*x + c) - 2*(2*a^5 - 3*a^3 
*b^2 + a*b^4)*cos(d*x + c)^2 - 2*(a^4*b - a^2*b^3)*sin(d*x + c))/((a^6 - 2 
*a^4*b^2 + a^2*b^4)*d*cos(d*x + c)*sin(d*x + c))]
 
3.14.44.6 Sympy [F]

\[ \int \frac {\csc ^2(c+d x) \sec ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\int \frac {\csc ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{a + b \sin {\left (c + d x \right )}}\, dx \]

input
integrate(csc(d*x+c)**2*sec(d*x+c)**2/(a+b*sin(d*x+c)),x)
 
output
Integral(csc(c + d*x)**2*sec(c + d*x)**2/(a + b*sin(c + d*x)), x)
 
3.14.44.7 Maxima [F(-2)]

Exception generated. \[ \int \frac {\csc ^2(c+d x) \sec ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\text {Exception raised: ValueError} \]

input
integrate(csc(d*x+c)^2*sec(d*x+c)^2/(a+b*sin(d*x+c)),x, algorithm="maxima" 
)
 
output
Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?` f 
or more de
 
3.14.44.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 259 vs. \(2 (123) = 246\).

Time = 0.40 (sec) , antiderivative size = 259, normalized size of antiderivative = 2.02 \[ \int \frac {\csc ^2(c+d x) \sec ^2(c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {\frac {12 \, {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )} b^{4}}{{\left (a^{4} - a^{2} b^{2}\right )} \sqrt {a^{2} - b^{2}}} + \frac {6 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a^{2}} - \frac {3 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a} - \frac {2 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 15 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 3 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 10 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, a^{3} - 3 \, a b^{2}}{{\left (a^{4} - a^{2} b^{2}\right )} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}}{6 \, d} \]

input
integrate(csc(d*x+c)^2*sec(d*x+c)^2/(a+b*sin(d*x+c)),x, algorithm="giac")
 
output
-1/6*(12*(pi*floor(1/2*(d*x + c)/pi + 1/2)*sgn(a) + arctan((a*tan(1/2*d*x 
+ 1/2*c) + b)/sqrt(a^2 - b^2)))*b^4/((a^4 - a^2*b^2)*sqrt(a^2 - b^2)) + 6* 
b*log(abs(tan(1/2*d*x + 1/2*c)))/a^2 - 3*tan(1/2*d*x + 1/2*c)/a - (2*a^2*b 
*tan(1/2*d*x + 1/2*c)^3 - 2*b^3*tan(1/2*d*x + 1/2*c)^3 - 15*a^3*tan(1/2*d* 
x + 1/2*c)^2 + 3*a*b^2*tan(1/2*d*x + 1/2*c)^2 + 10*a^2*b*tan(1/2*d*x + 1/2 
*c) + 2*b^3*tan(1/2*d*x + 1/2*c) + 3*a^3 - 3*a*b^2)/((a^4 - a^2*b^2)*(tan( 
1/2*d*x + 1/2*c)^3 - tan(1/2*d*x + 1/2*c))))/d
 
3.14.44.9 Mupad [B] (verification not implemented)

Time = 14.48 (sec) , antiderivative size = 778, normalized size of antiderivative = 6.08 \[ \int \frac {\csc ^2(c+d x) \sec ^2(c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {\left (a\,b^6\,1{}\mathrm {i}-a^7\,\cos \left (2\,c+2\,d\,x\right )\,2{}\mathrm {i}-a^3\,b^4\,2{}\mathrm {i}+a^5\,b^2\,1{}\mathrm {i}+a\,b^6\,\cos \left (2\,c+2\,d\,x\right )\,1{}\mathrm {i}-a^6\,b\,\sin \left (2\,c+2\,d\,x\right )\,1{}\mathrm {i}-a^2\,b^5\,\sin \left (c+d\,x\right )\,2{}\mathrm {i}+a^4\,b^3\,\sin \left (c+d\,x\right )\,4{}\mathrm {i}-a^3\,b^4\,\cos \left (2\,c+2\,d\,x\right )\,4{}\mathrm {i}+a^5\,b^2\,\cos \left (2\,c+2\,d\,x\right )\,5{}\mathrm {i}+b^7\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\sin \left (2\,c+2\,d\,x\right )\,1{}\mathrm {i}-a^2\,b^5\,\sin \left (2\,c+2\,d\,x\right )\,1{}\mathrm {i}+a^4\,b^3\,\sin \left (2\,c+2\,d\,x\right )\,2{}\mathrm {i}-a^6\,b\,\sin \left (c+d\,x\right )\,2{}\mathrm {i}-a^6\,b\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\sin \left (2\,c+2\,d\,x\right )\,1{}\mathrm {i}+2\,b^4\,\sin \left (2\,c+2\,d\,x\right )\,\mathrm {atan}\left (\frac {a^4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}\,1{}\mathrm {i}+b^4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}\,4{}\mathrm {i}-a^2\,b^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}\,3{}\mathrm {i}+a\,b^3\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}\,2{}\mathrm {i}-a^3\,b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^7+2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^6\,b-3\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^5\,b^2-7\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^4\,b^3+4\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3\,b^4+9\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b^5-2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^6-4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^7}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}-a^2\,b^5\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\sin \left (2\,c+2\,d\,x\right )\,3{}\mathrm {i}+a^4\,b^3\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\sin \left (2\,c+2\,d\,x\right )\,3{}\mathrm {i}\right )\,1{}\mathrm {i}}{a^2\,d\,\sin \left (2\,c+2\,d\,x\right )\,\left (a^2-b^2\right )\,\left (a^4-2\,a^2\,b^2+b^4\right )} \]

input
int(1/(cos(c + d*x)^2*sin(c + d*x)^2*(a + b*sin(c + d*x))),x)
 
output
-((a*b^6*1i - a^7*cos(2*c + 2*d*x)*2i - a^3*b^4*2i + a^5*b^2*1i + a*b^6*co 
s(2*c + 2*d*x)*1i - a^6*b*sin(2*c + 2*d*x)*1i - a^2*b^5*sin(c + d*x)*2i + 
a^4*b^3*sin(c + d*x)*4i - a^3*b^4*cos(2*c + 2*d*x)*4i + a^5*b^2*cos(2*c + 
2*d*x)*5i + b^7*log(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))*sin(2*c + 2*d*x 
)*1i - a^2*b^5*sin(2*c + 2*d*x)*1i + a^4*b^3*sin(2*c + 2*d*x)*2i - a^6*b*s 
in(c + d*x)*2i - a^6*b*log(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))*sin(2*c 
+ 2*d*x)*1i + 2*b^4*sin(2*c + 2*d*x)*atan((a^4*sin(c/2 + (d*x)/2)*(b^6 - a 
^6 - 3*a^2*b^4 + 3*a^4*b^2)^(1/2)*1i + b^4*sin(c/2 + (d*x)/2)*(b^6 - a^6 - 
 3*a^2*b^4 + 3*a^4*b^2)^(1/2)*4i - a^2*b^2*sin(c/2 + (d*x)/2)*(b^6 - a^6 - 
 3*a^2*b^4 + 3*a^4*b^2)^(1/2)*3i + a*b^3*cos(c/2 + (d*x)/2)*(b^6 - a^6 - 3 
*a^2*b^4 + 3*a^4*b^2)^(1/2)*2i - a^3*b*cos(c/2 + (d*x)/2)*(b^6 - a^6 - 3*a 
^2*b^4 + 3*a^4*b^2)^(1/2)*1i)/(a^7*cos(c/2 + (d*x)/2) - 4*b^7*sin(c/2 + (d 
*x)/2) - 2*a*b^6*cos(c/2 + (d*x)/2) + 2*a^6*b*sin(c/2 + (d*x)/2) + 4*a^3*b 
^4*cos(c/2 + (d*x)/2) - 3*a^5*b^2*cos(c/2 + (d*x)/2) + 9*a^2*b^5*sin(c/2 + 
 (d*x)/2) - 7*a^4*b^3*sin(c/2 + (d*x)/2)))*(b^6 - a^6 - 3*a^2*b^4 + 3*a^4* 
b^2)^(1/2) - a^2*b^5*log(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))*sin(2*c + 
2*d*x)*3i + a^4*b^3*log(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))*sin(2*c + 2 
*d*x)*3i)*1i)/(a^2*d*sin(2*c + 2*d*x)*(a^2 - b^2)*(a^4 + b^4 - 2*a^2*b^2))